package cus1156.lab6;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class CatListTest {
    private CatList list;
    
	@Before
	public void setUp() throws Exception {
		list = new CatList();
	}

	@Test
	public void testAddCat() {
		list.addCat(new Cat("Joe", "orange", "pat"));
		list.addCat(new Cat("Fluffy", "calico", "jon"));
		assertEquals(list.getCatAtPos(0).getName(), "Joe");
		assertEquals(list.getCatAtPos(1).getName(), "Fluffy");
		
	}

	@Test
	public void testHowManyCats() {
		list.addCat(new Cat());
		list.addCat(new Cat());
		assertEquals(list.howManyCats(),2);
		list.addCat(new Cat());
		assertEquals(list.howManyCats(),3);
	}
	
	@Test
	public void testgetNumColorCat(){
		list.addCat(new Cat("Bob", "orange", "Tabby"));
		list.addCat(new Cat("Jon", "black", "Tabby"));
		list.addCat(new Cat("Sid", "orange", "Tabby"));
		assertEquals(list.getNumColorCat("orange"), 2);
	}
	/**
	 * test for getcatname JT
	 */
@Test
		public void testgetCatByName(){
			list.addCat(new Cat("JOEY", "ORange", "TaBBy"));
		assertEquals(list.GetCatByName("JOEY").getName().length(),4);
		}
	}

